package mi.payment.settings;

import java.io.Serializable;

import mi.payment.BuildConfig;
import mi.payment.constants.Configs;

/**
 * 系统参数设置
 *
 * @author Xiho on 2017/1/8.
 */
public class SystemParamsSettings implements Serializable {

    // 文件无变化
    private static final long serialVersionUID = -3681211149642798804L;

    /**
     * 交易管理设置的key
     **/
    public final static String TRANSACTION_MANAGER_KEY = "SystemParamsSettings";

    // 最大交易笔数设置	999max
    public final static int MAX_TRANSACTION_NUMBER = 9999;

    // 流水号起始
    private String serialNum = Configs.getInstance().SERIAL_NUM();
    // 批次号起始
    private String batchNumStart = Configs.getInstance().BATCHNUM_START();

    // 套打签购单样式	0-新／1-空白签购单
    private int purchaseOrderStyle = 1;
    // 冲正重发次数	1-3次
    private int correctFrequency = Configs.getInstance().CORRECT_FREQUENCY();
    // 最大交易笔数设置	999max
    private int transactionNumber = Configs.getInstance().MAX_TRANSACTION_NUMBER();
    // 撤销类交易打印负号	是否
    private boolean printNegative = Configs.getInstance().PRINT_NEGATIVE();
    // 非接交易通道开关	0联机借贷记交易优先  1电子现金交易优先
    private int nonConnection = Configs.getInstance().NON_CONNECTION();
    // 是否支持国密	是否
    private boolean stateSecret = false;
    // 是否屏蔽预授权卡号	是否
    private boolean shieldAuthorizationCard = Configs.getInstance().SHIELD_AUTHORIZATION_CARD();
    // 非接选择	0自适应1外置2内置
    private int nonConnectionChoice = 2;
    // 电子现金免签	是否
    private boolean eCashVisaExemption = false;

    // 是否需要下载IC参数
    private boolean needDownLoadICParams = true;

    // 是否下载过一次参数
    private boolean isDownloadParamsOnce = false;

    public boolean isDownloadParamsOnce() {
        return isDownloadParamsOnce;
    }

    protected void setDownloadParamsOnce(boolean downloadParamsOnce) {
        isDownloadParamsOnce = downloadParamsOnce;
    }

    public boolean isNeedDownLoadICParams() {
        return needDownLoadICParams;
    }

    protected void setNeedDownLoadICParams(boolean needDownLoadICParams) {
        this.needDownLoadICParams = needDownLoadICParams;
    }

    public String getCurrentSerialNum() {
        return serialNum;
    }

    public String getBatchNumStart() {
        return batchNumStart;
    }

    public int getPurchaseOrderStyle() {
        return purchaseOrderStyle;
    }

    public int getCorrectFrequency() {
        return correctFrequency;
    }

    public int getTransactionNumber() {
        return transactionNumber;
    }

    public boolean isPrintNegative() {
        return printNegative;
    }

    public int getNonConnection() {
        return nonConnection;
    }

    public boolean isStateSecret() {
        return stateSecret;
    }

    public boolean isShieldAuthorizationCard() {
        return shieldAuthorizationCard;
    }

    public int getNonConnectionChoice() {
        return nonConnectionChoice;
    }

    public boolean iseCashVisaExemption() {
        return eCashVisaExemption;
    }

    protected void setSerialNum(String serialNum) {
        this.serialNum = serialNum;
    }

    protected void setBatchNumStart(String batchNumStart) {
        this.batchNumStart = batchNumStart;
    }

    protected void setPurchaseOrderStyle(int purchaseOrderStyle) {
        this.purchaseOrderStyle = purchaseOrderStyle;
    }

    protected void setCorrectFrequency(int correctFrequency) {
        this.correctFrequency = correctFrequency;
    }

    protected void setTransactionNumber(int transactionNumber) {
        this.transactionNumber = transactionNumber;
    }

    protected void setPrintNegative(boolean printNegative) {
        this.printNegative = printNegative;
    }

    protected void setNonConnection(int nonConnection) {
        this.nonConnection = nonConnection;
    }

    protected void setStateSecret(boolean stateSecret) {
        this.stateSecret = stateSecret;
    }

    protected void setShieldAuthorizationCard(boolean shieldAuthorizationCard) {
        this.shieldAuthorizationCard = shieldAuthorizationCard;
    }

    protected void setNonConnectionChoice(int nonConnectionChoice) {
        this.nonConnectionChoice = nonConnectionChoice;
    }

    protected void setCashVisaExemption(boolean eCashVisaExemption) {
        this.eCashVisaExemption = eCashVisaExemption;
    }

}
